<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      div{
          width: 400px;
          height: 400px;
          border:1px red solid;
          margin: 100px auto;
      }

    </style>
</head>
<body>

      <div></div>
    
</body>
</html>
<script>
/*
    click: 点击
    dblclick:双击
    onmouseover: 鼠标移入
    onmouseout: 鼠标移出
    onmousedown: 鼠标按钮
    onmouseup: 鼠标抬起
    onmousemove:鼠标移动
     onmouseenter: 鼠标进入
     onmouseLeave:鼠标离开
*/

 let divObj = document.getElementsByTagName('div')[0];
//单击
 divObj.onclick=()=>{
    console.log('click');
 }



</script>